import React from "react";
import { BrowserRouter, useRoutes, Navigate } from "react-router-dom";
const Pay = React.lazy(() => import("../views/pay"));
const PayDetail = React.lazy(() => import("../views/payDetail"));
const PayTable = React.lazy(() => import("../views/payTable"));
const Routes = [
  {
    path: "/pay",
    element: <Pay></Pay>,
  },
	{
    path: "/pay/detail",
    element: <PayDetail></PayDetail>,
  },
	{
    path: "/pay/table",
    element: <PayTable></PayTable>,
  },
	{
    path: "/",
    element: <Navigate to="/pay"></Navigate>,
  },
];

const RouterView = () => {
	const Router = () => useRoutes(Routes)
	return (
		<BrowserRouter>
			<Router></Router>
		</BrowserRouter>
	)
}

export default RouterView